<!DOCTYPE html>
<html lang="zh-CN">
    <head>
  <!-- 元数据 -->
  <meta charset="utf-8">
  <link rel="icon" href="/blog/images/logo.png">
  
  <title>【CORS】跨域资源共享 | 溪岚花的博客</title>
  
  <meta name="author" content="林家隆" />
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="robots" content="index,follow" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <meta name="format-detection" content="telphone=no, email=no" />
  
    <meta name="keywords" content="CORS" />
  
  <meta name="description" content="什么是跨域请求什么是跨域请求：通过 http:&#x2F;&#x2F;localhost:8080 获得前端页面，但是前端页面 ajax 发起了 http:&#x2F;&#x2F;localhost:9090 后端请求。因为 ajax 发起的请求符合 3 种情况跨域中的一种（端口不同），所以说 ajax 这次发出的请求是跨域请求。 出现跨域请求的 3 种情况：  协议不同，如 http 和 htt">
<meta property="og:type" content="article">
<meta property="og:title" content="【CORS】跨域资源共享">
<meta property="og:url" content="https://lin316.gitee.io/blog/2024/03/29/JavaWeb/CORS/index.html">
<meta property="og:site_name" content="溪岚花的博客">
<meta property="og:description" content="什么是跨域请求什么是跨域请求：通过 http:&#x2F;&#x2F;localhost:8080 获得前端页面，但是前端页面 ajax 发起了 http:&#x2F;&#x2F;localhost:9090 后端请求。因为 ajax 发起的请求符合 3 种情况跨域中的一种（端口不同），所以说 ajax 这次发出的请求是跨域请求。 出现跨域请求的 3 种情况：  协议不同，如 http 和 htt">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://lin316.gitee.io/blog/blog/images/logo.png">
<meta property="article:published_time" content="2024-03-29T01:00:00.000Z">
<meta property="article:modified_time" content="2025-11-20T11:35:22.184Z">
<meta property="article:author" content="林家隆">
<meta property="article:tag" content="CORS">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://lin316.gitee.io/blog/blog/images/logo.png">
  
  <!-- 站点验证相关 -->
  
    
    
    
  
  <!-- 样式表文件 -->
  <link rel="stylesheet" id="kratos-css" href="/blog/css/kratosr.min.css" media="all"></script>
  
    <link rel="stylesheet" id="darkmode-css" href="/blog/css/kr-color-dark.min.css" media="(prefers-color-scheme: dark)"></script>
    <script src="/blog/js/kr-dark.min.js"></script>
  
  
    <link rel="stylesheet" id="highlight-css" href="/blog/css/highlight/night-eighties.min.css" media="all"></script>
  
  <link rel="stylesheet" id="fontawe-css" href="/blog/vendors/font-awesome@4.7.0/css/font-awesome.min.css" media="all"></script>
  <link rel="stylesheet" id="nprogress-css" href="/blog/vendors/nprogress@0.2.0/nprogress.css" media="all"></script>
  
  
  
    <link rel="stylesheet" href="/blog/vendors/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css"></script>
  
  <!-- 不得不预先加载的一些JS文件 -->
  <script src="/blog/vendors/jquery@3.6.0/dist/jquery.min.js"></script>
  
  
  <style>
    
    
  </style>
  
<meta name="generator" content="Hexo 6.3.0"></head>


    <body class="custom-background">
        <div id="kratos-wrapper">
    <div id="kratos-page">
        <div id="kratos-header">
            <header id="kratos-desktop-topnav" class="kratos-topnav">
                <div class="container">
                    <div class="nav-header">
                        <nav id="kratos-menu-wrap">
                            <ul id="kratos-primary-menu" class="sf-menu">
                                
                                    
                                        <li>
                                            
                                                <a href="/blog/">
                                            
                                                
                                                    <i class="fa fa-home"></i>
                                                
                                                首页
                                            </a>
                                            
                                        </li>
                                    
                                        <li>
                                            
                                                <a href="/blog/archives/">
                                            
                                                
                                                    <i class="fa fa-file"></i>
                                                
                                                归档
                                            </a>
                                            
                                        </li>
                                    
                                        <li>
                                            
                                                <a href="/blog/tags/">
                                            
                                                
                                                    <i class="fa fa-tag"></i>
                                                
                                                标签
                                            </a>
                                            
                                        </li>
                                    
                                        <li>
                                            
                                                <a href="/blog/categories/">
                                            
                                                
                                                    <i class="fa fa-folder"></i>
                                                
                                                目录
                                            </a>
                                            
                                        </li>
                                    
                                        <li>
                                            
                                                <a href="/blog/search/">
                                            
                                                
                                                    <i class="fa fa-search"></i>
                                                
                                                搜索
                                            </a>
                                            
                                        </li>
                                    
                                
                            </ul>
                        </nav>
                    </div>
                </div>
            </header>
            <header id="kratos-mobile-topnav" class="kratos-topnav">
                <div class="container">
                    <div class="color-logo"><a href="/blog/">溪岚花的博客</a></div>
                    <div class="nav-toggle">
                        <a class="kratos-nav-toggle js-kratos-nav-toggle">
                            <i></i>
                        </a>
                    </div>
                </div>
            </header>
        </div>
        <div class="kratos-start kratos-hero-2">
            <!-- <div class="kratos-overlay"></div> -->
            <div class="kratos-cover kratos-cover-2 text-center">
                <div class="desc desc2 animate-box">
                    <a href="/blog/">
                        <h2 style="opacity: 0.2;">溪岚花的博客</h2> <br />
                        <span></span>
                    </a>
                </div>
            </div>
        </div>

        <div id="kratos-blog-post">
            <div class="container">
                <div id="main" class="row">
                    

        

            <section class="col-md-8">

        

            <article itemscope itemtype="https://schema.org/Article">
    
    <link itemprop="mainEntityOfPage" href="https://lin316.gitee.io/blog/2024/03/29/JavaWeb/CORS/">
    <div class="kratos-hentry kratos-post-inner clearfix">
        <header class="kratos-entry-header">
            
                <h1 class="kratos-entry-title text-center" itemprop="name headline">【CORS】跨域资源共享</h1>
            
            
            <ul class="kratos-post-meta text-center">
                <li><time datetime="2024-03-29T01:00:00.000Z" itemprop="datePublished"><i class="fa fa-calendar"></i> 2024-03-29</time></li>
                <li itemprop="author" itemscope itemtype="https://schema.org/Person">
                    <i class="fa fa-user"></i> 作者 <span itemprop="name">林家隆</span>
                </li>
                
                    <li>
                        <i class="fa fa-edit"></i> 
                        
                        
                            3.03K
                        
                        字
                    </li>
                
                
            </ul>
        </header>
        <div class="kratos-post-content">
            
            <div id="expire-alert" class="alert alert-warning hidden" role="alert">
                <div class="icon"><i class="fa fa-warning"></i></div>
                <div class="text"><p>本文最后编辑于 <time datetime="1763638522184"></time> 前，其中的内容可能需要更新。</p></div>
            </div>
            
            
            
                <div class="kratos-post-inner-toc toc-div-class" >
                    <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BB%80%E4%B9%88%E6%98%AF%E8%B7%A8%E5%9F%9F%E8%AF%B7%E6%B1%82"><span class="toc-number">1.</span> <span class="toc-text">什么是跨域请求</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#CORS-%E4%BB%8B%E7%BB%8D"><span class="toc-number">2.</span> <span class="toc-text">CORS 介绍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%B7%A8%E5%9F%9F%E8%AF%B7%E6%B1%82%E7%9A%84%E5%88%86%E7%B1%BB"><span class="toc-number">3.</span> <span class="toc-text">跨域请求的分类</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AE%80%E5%8D%95%E8%AF%B7%E6%B1%82%E7%9A%84%E5%A4%84%E7%90%86%E6%96%B9%E5%BC%8F"><span class="toc-number">4.</span> <span class="toc-text">简单请求的处理方式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%8D%E6%9D%82%E8%AF%B7%E6%B1%82%E7%9A%84%E5%A4%84%E7%90%86%E6%96%B9%E5%BC%8F"><span class="toc-number">5.</span> <span class="toc-text">复杂请求的处理方式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#withCredentials-%E5%B1%9E%E6%80%A7"><span class="toc-number">6.</span> <span class="toc-text">withCredentials 属性</span></a></li></ol>
                </div>
            
            <hr />
            <div itemprop="articleBody"><h2 id="什么是跨域请求"><a href="#什么是跨域请求" class="headerlink" title="什么是跨域请求"></a>什么是跨域请求</h2><p><strong>什么是跨域请求：</strong>通过 http:&#x2F;&#x2F;localhost:8080 获得前端页面，但是前端页面 ajax 发起了 http:&#x2F;&#x2F;localhost:9090 后端请求。因为 ajax 发起的请求符合 3 种情况跨域中的一种（端口不同），所以说 ajax 这次发出的请求是跨域请求。</p>
<p><strong>出现跨域请求的 3 种情况：</strong></p>
<ul>
<li>协议不同，如 http 和 https。</li>
<li>域名不同。</li>
<li>端口不同。</li>
</ul>
<p><strong>注：</strong>从一个页面跳转到另一个页面，不算跨域。</p>
<h2 id="CORS-介绍"><a href="#CORS-介绍" class="headerlink" title="CORS 介绍"></a>CORS 介绍</h2><p>CORS 是一个协议，<strong>定义了”跨域资源共享”的协议</strong>。</p>
<p>它允许浏览器向跨域服务器，发出 <strong>XMLHttpRequest</strong> 跨域请求，让 AJAX 请求不仅限于同域服务器。CORS 协议需要浏览器和服务器同时支持才能发出跨域请求。</p>
<p>基本上浏览器都是支持 CORS 协议的。在前端，使用 AJAX 发起同源请求和跨域请求的代码是一样的。浏览器如果发现 AJAX 发起的请求是跨域请求，就会根据 CORS 协议对跨域请求进行处理。</p>
<p>因此，能否实现 CORS 跨域请求的关键在服务器。只有服务器根据 CORS 协议进行相关配置，才可以跨域通信。</p>
<h2 id="跨域请求的分类"><a href="#跨域请求的分类" class="headerlink" title="跨域请求的分类"></a>跨域请求的分类</h2><p>CORS 标准将跨域请求分为两类：简单请求和复杂请求。对这两类跨域请求的处理方式也不一样。</p>
<blockquote>
<p>只要满足以下两大条件就属于简单请求：</p>
<p>（1）请求方法是以下三种之一：</p>
<ul>
<li>HEAD</li>
<li>GET</li>
<li>POST</li>
</ul>
<p>（2）HTTP 的头信息只能含有以下几种字段：</p>
<ul>
<li>Accept</li>
<li>Accept-Language</li>
<li>Content-Language</li>
<li>Last-Event-ID</li>
<li>Content-Type：只限于三个值 application&#x2F;x-www-form-urlencoded、multipart&#x2F;form-data、text&#x2F;plain</li>
</ul>
</blockquote>
<p>不能同时满足以上两个条件的请求，就属于复杂请求。</p>
<h2 id="简单请求的处理方式"><a href="#简单请求的处理方式" class="headerlink" title="简单请求的处理方式"></a>简单请求的处理方式</h2><p>对于简单请求，浏览器在 AJAX 请求的基础上，在头信息中添加一个 <strong>Origin</strong> 字段。<strong>Origin 字段会说明本次跨域请求来自哪个源</strong>。</p>
<figure class="highlight http"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">GET</span> <span class="string">/user/1</span> <span class="meta">HTTP/1.1</span></span><br><span class="line"><span class="attribute">Accept-Language</span><span class="punctuation">: </span>zh-CN,zh;q=0.9</span><br><span class="line"><span class="attribute">Connection</span><span class="punctuation">: </span>keep-alive</span><br><span class="line"><span class="attribute">Host</span><span class="punctuation">: </span>localhost:10010</span><br><span class="line"><span class="attribute">Origin</span><span class="punctuation">: </span>http://localhost:10002</span><br><span class="line">.....</span><br></pre></td></tr></table></figure>

<p>服务器根据 Origin 字段判断是否允许跨域，如果允许，服务器返回的响应头信息会包含 <strong>Access-Control-Allow-Origin</strong> 字段，不允许就不会包含该字段。</p>
<p>如果浏览器发现发出去的跨域请求得到响应的响应头信息不包含 <strong>Access-Control-Allow-Origin</strong> 字段，就在控制台抛出一个错误：</p>
<p><img src="/blog/2024/03/29/JavaWeb/CORS/image-20240328111943053.png"></p>
<p>如果服务器允许，服务器返回的响应头信息里会多出以下几个字段：</p>
<figure class="highlight http"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">Access-Control-Allow-Origin</span><span class="punctuation">: </span>http://localhost:10002</span><br><span class="line"><span class="attribute">Access-Control-Allow-Credentials</span><span class="punctuation">: </span>true</span><br><span class="line"><span class="attribute">Access-Control-Expose-Headers</span><span class="punctuation">: </span>Token</span><br></pre></td></tr></table></figure>

<ul>
<li><strong>Access-Control-Allow-Origin：</strong>该字段是必须的。它的值要么是请求时 <strong>Origin</strong> 字段的值，要么是一个 *****，表示接受任意域名的请求。</li>
<li><strong>Access-Control-Allow-Credentials：</strong>该字段可选。它的值是一个布尔值，表示是否允许发送 Cookie。默认情况下，CORS 跨域请求不能携带 Cookie 信息。设为 true，表示服务器允许接收同源 Cookie。</li>
<li><strong>Access-Control-Expose-Headers：</strong>CORS 跨域请求，如果服务器想获得其它请求头字段信息，需要在该字段指定。</li>
</ul>
<h2 id="复杂请求的处理方式"><a href="#复杂请求的处理方式" class="headerlink" title="复杂请求的处理方式"></a>复杂请求的处理方式</h2><p>CORS 规定，在发起复杂的跨域请求前，需要先发送一次 OPTIONS 请求询问跨域服务器是否可以接收跨域请求。浏览器只有得到跨域服务器的肯定答复才会发送跨域请求。</p>
<p><img src="/blog/2024/03/29/JavaWeb/CORS/image-20240328124834999.png"></p>
<blockquote>
<p><strong>OPTIONS 请求头信息：</strong></p>
<figure class="highlight http"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">OPTIONS</span> <span class="string">/user/1</span> <span class="meta">HTTP/1.1</span></span><br><span class="line"><span class="attribute">Origin</span><span class="punctuation">: </span>http://localhost:10002</span><br><span class="line"><span class="attribute">Access-Control-Request-Method</span><span class="punctuation">: </span>GET</span><br><span class="line"><span class="attribute">Access-Control-Request-Headers</span><span class="punctuation">: </span>token</span><br><span class="line"><span class="attribute">Accept-Language</span><span class="punctuation">: </span>zh-CN,zh;q=0.9</span><br><span class="line"><span class="attribute">Connection</span><span class="punctuation">: </span>keep-alive</span><br><span class="line"><span class="attribute">Host</span><span class="punctuation">: </span>localhost:10010</span><br><span class="line">.....</span><br></pre></td></tr></table></figure>

<ul>
<li>Origin：说明本次跨域请求来自哪个源。</li>
<li>Access-Control-Request-Method：说明本次跨域请求的方法是什么。</li>
<li>Access-Control-Request-Headers：说明本次跨域请求会额外携带的头信息。</li>
</ul>
</blockquote>
<blockquote>
<p><strong>OPTIONS 响应头信息：</strong></p>
<figure class="highlight http"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">HTTP/1.1</span> <span class="number">200</span> OK</span><br><span class="line"><span class="attribute">Access-Control-Allow-Origin</span><span class="punctuation">: </span>http://localhost:10002</span><br><span class="line"><span class="attribute">Access-Control-Allow-Methods</span><span class="punctuation">: </span>GET,POST,DELETE,PUT,OPTIONS</span><br><span class="line"><span class="attribute">Access-Control-Allow-Headers</span><span class="punctuation">: </span>token, name</span><br><span class="line"><span class="attribute">Access-Control-Allow-Credentials</span><span class="punctuation">: </span>true</span><br><span class="line"><span class="attribute">Access-Control-Max-Age</span><span class="punctuation">: </span>360000</span><br><span class="line">.....</span><br></pre></td></tr></table></figure>

<ul>
<li>Access-Control-Allow-Origin：表示接受哪些任意域名的跨域请求，星号表示接收所有的跨域请求。</li>
<li>Access-Control-Allow-Methods：表示服务器支持的跨域请求方法。</li>
<li>Access-Control-Allow-Headers：表示服务器支持的跨域请求头字段。</li>
<li>Access-Control-Allow-Credentials：表示服务器是否支持跨域请求携带 Cookie 信息。</li>
<li>Access-Control-Max-Age：用来说明本次 OPTIONS 请求的有效期，单位为秒。在有效期内，不需要再发送相同的 OPTIONS 请求。</li>
</ul>
</blockquote>
<p>一旦服务器通过了浏览器的 OPTIONS 请求，在有效期内，浏览器对后面复杂的跨域请求的处理方式跟简单请求一样，只在跨域请求头信息添加 Origin 字段就行，不需要再发送 OPTIONS 请求。</p>
<h2 id="withCredentials-属性"><a href="#withCredentials-属性" class="headerlink" title="withCredentials 属性"></a>withCredentials 属性</h2><p>CORS 跨域请求默认不携带 Cookie 信息。如果要携带 Cookie 信息，一方面要服务器同意，使 Access-Control-Allow-Credentials 字段为 true，另一方面前端开发者需要在 AJAX 请求中把 withCredentials 属性设置为 true。否则即使服务器同意接收 Cookie，浏览器处理跨域请求时候也不会携带 Cookie 信息。</p>
<p>注意，如果服务器要接收 Cookie 信息，在配置 <strong>Access-Control-Allow-Origin</strong> 时候就不能设为星号，必须指定明确的、与请求网页一致的域名。</p>
</div>
        </div>
        
        <footer class="kratos-entry-footer clearfix">
            
            <div class="footer-tag clearfix">
                <div class="pull-left">
                <i class="fa fa-tags"></i>
                    <a class="tag-none-link" href="/blog/tags/CORS/" rel="tag">CORS</a>
                </div>
                <div class="pull-date">
                    <time datetime="2025-11-20T11:35:22.184Z" itemprop="dateModified">最后编辑：2025-11-20</time>
                </div>
            </div>
        </footer>
    </div>
    
        <nav class="navigation post-navigation clearfix" role="navigation">
            
            <div class="nav-previous clearfix">
                <a title=" 【Gateway】基本使用" href="/blog/2024/03/28/SpringCloud/Gateway/Gateway基本使用/">&lt; 上一篇</a>
            </div>
            
            
            <div class="nav-next clearfix">
                <a title=" 【RabbitMQ】基本使用" href="/blog/2024/03/31/SpringCloud/RabbitMQ/RabbitMQ基础/">下一篇 &gt;</a>
            </div>
            
        </nav>
    
    
</article>

        

            </section>

        

                
            

<section id="kratos-widget-area" class="col-md-4 hidden-xs hidden-sm">
    <!-- 文章和页面根据splitter来分割，没有的话就从头开始设置为sticky -->
    
    
                <aside id="krw-about" class="widget widget-kratos-about clearfix">
    <div class="photo-background"></div>
    <div class="photo-wrapper clearfix">
        <div class="photo-wrapper-tip text-center">
            <img class="about-photo" src="/blog/images/avatar.webp" loading="lazy" decoding="auto" />
        </div>
    </div>
    <div class="textwidget">
        <p class="text-center">极简主义</p>
    </div>
    <div class="site-meta">
        <a class="meta-item" href="/blog/archives/">
            <span class="title">
                文章
            </span>
            <span class="count">
                72
            </span>
        </a>
        <a class="meta-item" href="/blog/categories/">
            <span class="title">
                分类
            </span>
            <span class="count">
                9
            </span>
        </a>
        <a class="meta-item" href="/blog/tags/">
            <span class="title">
                标签
            </span>
            <span class="count">
                27
            </span>
        </a>
    </div>
</aside>
            
                    <div class="sticky-area">
                
                    <aside id="krw-toc" class="widget widget-kratos-toc clearfix toc-div-class" >
    <div class="photo-background"></div>
    <h4 class="widget-title no-after">
        <i class="fa fa-compass"></i>
        文章目录
        <span class="toc-progress-bar" role="progressbar" aria-label="阅读进度："></span>
    </h4>
    <div class="textwidget">
        <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BB%80%E4%B9%88%E6%98%AF%E8%B7%A8%E5%9F%9F%E8%AF%B7%E6%B1%82"><span class="toc-text">什么是跨域请求</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#CORS-%E4%BB%8B%E7%BB%8D"><span class="toc-text">CORS 介绍</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E8%B7%A8%E5%9F%9F%E8%AF%B7%E6%B1%82%E7%9A%84%E5%88%86%E7%B1%BB"><span class="toc-text">跨域请求的分类</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AE%80%E5%8D%95%E8%AF%B7%E6%B1%82%E7%9A%84%E5%A4%84%E7%90%86%E6%96%B9%E5%BC%8F"><span class="toc-text">简单请求的处理方式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%8D%E6%9D%82%E8%AF%B7%E6%B1%82%E7%9A%84%E5%A4%84%E7%90%86%E6%96%B9%E5%BC%8F"><span class="toc-text">复杂请求的处理方式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#withCredentials-%E5%B1%9E%E6%80%A7"><span class="toc-text">withCredentials 属性</span></a></li></ol>
    </div>
</aside>
                
                
  <aside id="krw-categories" class="widget widget-kratos-categories clearfix">
    <h4 class="widget-title"><i class="fa fa-folder"></i>分类目录</h4>
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/blog/categories/Docker/">Docker</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/Idea/">Idea</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/Java/">Java</a><span class="category-list-count">11</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/Linux/">Linux</a><span class="category-list-count">7</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/MySQL/">MySQL</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/Python/">Python</a><span class="category-list-count">11</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/Selenium/">Selenium</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/SpringBoot/">SpringBoot</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/blog/categories/SpringCloud/">SpringCloud</a><span class="category-list-count">13</span></li></ul>
  </aside>


            
                
  <aside id="krw-tags" class="widget widget-kratos-tags clearfix">
    <h4 class="widget-title"><i class="fa fa-tags"></i>标签聚合</h4>
      <div class="tag-clouds">
        <a href="/blog/tags/CORS/" style="font-size: 0.8em;">CORS</a> <a href="/blog/tags/Docker/" style="font-size: 0.8em;">Docker</a> <a href="/blog/tags/Dubbo/" style="font-size: 0.8em;">Dubbo</a> <a href="/blog/tags/ELK/" style="font-size: 0.8em;">ELK</a> <a href="/blog/tags/Elasticsearch/" style="font-size: 0.8em;">Elasticsearch</a> <a href="/blog/tags/Eureka/" style="font-size: 0.8em;">Eureka</a> <a href="/blog/tags/Feign/" style="font-size: 0.8em;">Feign</a> <a href="/blog/tags/Gateway/" style="font-size: 0.8em;">Gateway</a> <a href="/blog/tags/Idea/" style="font-size: 0.8em;">Idea</a> <a href="/blog/tags/Java/" style="font-size: 0.8em;">Java</a> <a href="/blog/tags/JavaWeb/" style="font-size: 0.8em;">JavaWeb</a> <a href="/blog/tags/Linux/" style="font-size: 0.8em;">Linux</a> <a href="/blog/tags/Maven/" style="font-size: 0.8em;">Maven</a> <a href="/blog/tags/MySQL/" style="font-size: 0.8em;">MySQL</a> <a href="/blog/tags/Mybatis/" style="font-size: 0.8em;">Mybatis</a> <a href="/blog/tags/Nacos/" style="font-size: 0.8em;">Nacos</a> <a href="/blog/tags/Pytest/" style="font-size: 0.8em;">Pytest</a> <a href="/blog/tags/Python/" style="font-size: 0.8em;">Python</a>
      </div>
  </aside>

            
                
  <aside id="krw-posts" class="widget widget-kratos-posts">
  <h4 class="widget-title"><i class="fa fa-file"></i>最新文章</h4>
  <div class="tab-content">
      <ul class="list-group">
        
        
          
          
            <a class="list-group-item" href="/blog/2024/04/07/Java%E6%97%A5%E5%BF%97%E6%A1%86%E6%9E%B6/Java%E6%97%A5%E5%BF%97%E6%A1%86%E6%9E%B6/"><i class="fa  fa-book"></i> 【Java】常见的日志框架</a>
            
          
        
          
          
            <a class="list-group-item" href="/blog/2024/04/06/SpringCloud/ElasticStack/Elasticsearch%E6%90%9C%E7%B4%A2%E8%AF%AD%E6%B3%95/"><i class="fa  fa-book"></i> 【ES】搜索语法</a>
            
          
        
          
          
            <a class="list-group-item" href="/blog/2024/04/03/SpringCloud/ElasticStack/Elasticsearch%E7%B4%A2%E5%BC%95%E9%85%8D%E7%BD%AE/"><i class="fa  fa-book"></i> 【ES】索引配置</a>
            
          
        
          
          
            <a class="list-group-item" href="/blog/2024/04/02/SpringCloud/ElasticStack/Kibana%E5%B8%B8%E7%94%A8%E5%8A%9F%E8%83%BD/"><i class="fa  fa-book"></i> 【Kibana】常用功能</a>
            
          
        
          
          
            <a class="list-group-item" href="/blog/2024/04/02/SpringCloud/ElasticStack/IK%E5%88%86%E8%AF%8D%E5%99%A8/"><i class="fa  fa-book"></i> 【IK 分词器】基本使用</a>
            
          
        
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
          
            
      </ul>
  </div>
  </aside>

            
    </div>
</section>
        
        </div>
    </div>
</div>
<footer>
    <div id="footer"  >
        <div class="container">
            <div class="row">
                <div class="col-md-6 col-md-offset-3 footer-list text-center">
                    <ul class="kratos-social-icons">
                        <!-- Keep for compatibility -->
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        <!-- New links -->
                        
                    </ul>
                    <ul class="kratos-copyright">
                        <div>
                            <li>&copy; 2025 溪岚花的博客 版权所有.</li>
                            <li>本站已运行<span id="span_dt">Loading...</span></li>
                        </div>
                        <div>
                            <li>Theme <a href="https://github.com/Candinya/Kratos-Rebirth" target="_blank">Kratos:Rebirth</a></li>
                            <li>Site built with&nbsp;<i class="fa fa-heart throb" style="color:#d43f57"></i>&nbsp;by 林家隆.</li>
                        </div>
                        <div>
                            <li>Powered by <a href="https://hexo.io" target="_blank" rel="nofollow">Hexo</a></li>
                            <li>Hosted on <a href="https://gitee.com/" target="_blank">Gitee Pages</a></li>
                        </div>
                        <div>
                            
                            
                        </div>
                    </ul>
                </div>
            </div>
        </div>
        <div class="kr-tool text-center">
            <div class="tool">
                
                    <div class="box search-box">
                        <a href="/blog/search/">
                            <span class="fa fa-search"></span>
                        </a>
                    </div>
                
                
                    <div class="box theme-box" id="darkmode-switch">
                        <span class="fa fa-adjust"></span>
                    </div>
                
                
                
            </div>
            <div class="box gotop-box">
                <span class="fa fa-chevron-up"></span>
            </div>
        </div>
    </div>
</footer>
</div>
</div>

        <script defer src="/blog/vendors/bootstrap@3.3.4/dist/js/bootstrap.min.js"></script>
<script defer src="/blog/vendors/nprogress@0.2.0/nprogress.js"></script>
<script>
    if (!window.kr) {
        window.kr = {};
    }
    window.kr.notMobile = (!(navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)));
    window.kr.siteRoot = "/blog/";
</script>





    <script defer src="/blog/vendors/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>

<script defer src="/blog/js/kratosr.min.js"></script>
<script defer src="/blog/js/pjax.min.js"></script>



<!-- Extra support for third-party plguins  -->


    </body>
</html>